<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreatePayCallbackLogTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('pay_callback_log', function (Blueprint $table) {
            $table->increments('id');
            $table->string('channel', 10)->default('')->comment('支付渠道：wechat-微信，alipay-支付宝');
            $table->string('out_trade_no', 50)->default('')->comment('关联内部订单ID');
            $table->text('detail')->comment('回调内容');
            $table->timestamps();
            $table->tinyInteger('flag')->default(1)->comment('1-有效，0-无效');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('pay_callback_log');
    }
}
